home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Supervisor's Toolkit
/
Network Supervisor's Toolkit.iso
/
novell
/
nw386
/
nlm-9.386
< prev
next >
Wrap
Text File
|
1996-07-10
|
8KB
|
263 lines
Chapter 9
NetWare Loadable Modules
This section on the NetWare Loadable Module (NLM)
discusses the following:
■ Features
■ C RunTime Libraries
■ Types of NLMs
■ Loading an NLM
Features
A NetWare Loadable Module (NLM) is a program that you can
load and unload from server memory while the server is
running. When loaded, NLMs link with and become part of
the NetWare operating system as if they were hard-coded.
Yet when NLMs are unloaded from the NetWare operating
system, they return all the memory and resources that the
server allocated to them. Because NLMs are modular and
can be developed to meet a variety of needs, they add
openness and flexibility to the NetWare Operating System.
------------------------------------------
NLM Features
NLM features such as the following add
openness, modularity, and flexibility
to the NetWare operating system:
* NLM's can be loaded and unloaded
while the server is running
* NLM's can allocate and deallocate
memory as needed during loading
and unloading
* NLM's can link with and access the
NetWare OS and other NLM's
------------------------------------------
C RunTime Libraries
NLMs are similar to Value-Added Processes (VAPs) in that
they reside in server memory with the NetWare operating
system. However, unlike VAPs that have limited access
to NetWare through a set of Application Program Interface
(API) system calls, NLMs have more direct access to a
large number of server procedures. These server
procedures that NLMs can access are collectively called
the Loadable Module Interface and are derived from the
following APIs:
■ ANSI.C runtime library
■ POSIX API
■ Existing Microsoft, Borland, and Watcom C runtime
libraries
■ OS/2 execution thread API
■ NetWare C Interface library
Additional APIs encompassing features new in NetWare 386
are also contained in the NetWare 386 C RunTime
Libraries. To develop an NLM using the NetWare C RunTime
Libraries requires the following basic steps:■Design and write the NLM using one of the following:
C
386 protected mode assembly language
C++ using a preprocessor
■ Compile the code using Watcom 386 protected mode C
compiler, or assemble the program using Phar Lap's
386 protected mode assembler.
■ Using Novell's linker, NLMLINK, link the object
modules of the NLM with an object module called the
Prelude module, supplied with the Developers Kit.
Access to all other NetWare 386 C RunTime Library
procedures is via the dynamic link facility of
NetWare 386.
■ Debug the NLM code under NetWare 386 using the
built-in symbolic debugger or Watcom's remote
debugger (available 1Q 1990).
Note that in these steps the NLM is linked with only one
module (Prelude) from the C RunTime Libraries.
An NLM that uses the NetWare 386 C RunTime libraries
consist of the following pieces, at minimum:
■ Prelude module, supplied with the Developers Kit
■ Developer-written module that contains the function
main
When the NLM is loaded under NetWare 386, the Prelude
module gets control because it is defined as the NLM
start procedure. The Prelude module can perform the
following tasks:
■ Allocate and initialize all necessary NetWare 386
C RunTime Library data structures
■ Open a screen
■ Allocate a stack
■ Create a thread
The thread created by Prelude executes the main function
of the NLM. Then, this main function or any developer-
written function can call any of the procedures in the
NetWare 386 C RunTime libraries. Additional threads can
also be created with BeginThread, and threads can
terminate themselves or the entire NLM.
Types of NLMs
There are four basic types of NetWare Loadable Modules,
and NetWare 386 includes a number of NLMs from each of
these groups as shown below. Notice that since NetWare
386 v3.0 provides support for multiple file name
conventions, it includes one NLM for Macintosh naming
conventions, while support for DOS and OS/2 are hard-
coded in the NetWare OS.
---------------------------------------
TYPES OF NLM's
* Utilities and application modules
(.NLM extension)
DISKSET
INSTALL
MONITOR
PSERVER
UPS
VREPAIR
BTRIEVE
* LAN drivers (.LAN extension)
NE2
NE1000
NE2000
RXNET
TOKEN
* Disk drivers (.DSK extension)
DCB
DCB2
EDCB
ESDI
ISADISK
* Modules pertaining to file system
name spaces (.NAM extension)
MAC
---------------------------------------
Loading an NLM
The flexibility and wide range of capabilities these
various types of NLMs add to NetWare is perhaps most
evident as you see how easily they are loaded. Notice,
for example, how simple it is to add a disk driver, a
utility, and a LAN driver to the NetWare 386 core
operating system, thus expanding the capability of the
OS. To load a disk driver, perform the following steps:
1)Boot a 386 machine with a DOS diskette in drive A.
2)Replace the DOS diskette with the NetWare diskette
that includes the program SERVER.EXE, and type the
following at the DOS prompt.
server <Enter>
3)Insert a diskette that includes a disk driver. For
example, ISADSK.DSK (Industry Standard
Architecture.DSK) in drive A, and type the following
at the NetWare prompt.
load a:ISADISK.DSK <Enter>
4)The ISADSK.DSK disk driver loadable module, provided
by Novell, is loaded.
The LOAD console command links ISADSK.DSK with the
server's operating system, enabling the server to access
the numerous hard disks attached to the associated disk
controller. The INSTALL utility (INSTALL.NLM) is just
as simple. As with the disk driver, the INSTALL utility
is loaded from drive A and then linked to the operating
system simply by typing load a:install <Enter>. A
supervisor uses the INSTALL utility to create and edit
NetWare partitions on server hard disks and to create and
edit disk volumes. When the supervisor exits, INSTALL
unloads itself from server memory and returns to the
server all the memory it had previously allocated.
And finally, by installing a LAN driver NLM, you have a
basic, yet fully functioning 386 network. To install the
LAN driver, perform the following steps:
1)Mount volume sys by typing
mount volume sys <Enter>
2)Insert a diskette that incudes a LAN driver (for
example, NE1000.LAN in drive A.
3)Type the following at the NetWare prompt:
load a:ne1000 <Enter>
Again, the LOAD command in the last step above links the
LAN driver to the server's operating system and enables
a supervisor to add other LAN boards without bringing
down the server. NetWare supports an unlimited number
of LAN boards; however, hardware usually limits your
server to 4 boards.
The LAN driver (NE1000.LAN), the disk driver
(ISADSK.DSK), and the INSTALL utility (INSTALL.NLM) are
all NetWare Loadable Modules provided by Novell. Thus,
with NLMs you have a network with almost limitless
options that can be added, deleted, and interchanged with
one another to suit a particular environment.
It is also important to note here another type of NLM not
yet mentioned: a group of NLMs called NetWare Service
Enhancement Modules. NetWare Service Enhancement Modules
are server modules such as communication servers or print
servers. As with the other NLMs, NetWare Service
Enhancement Modules become integral parts of NetWare.
This integration with the NetWare OS is an important
advantage of NLMs.
For example, it allows for more speed, simplicity, and
options to third party developers writing to the NetWare
environment. Yet because NLMs become an integral part
of NetWare, and because they run in a nonpreemptive, or
what is sometimes referred to as a "nice guy"
environment, they must govern themselves. The NLM must
not take control of the CPU for indefinite periods of
time, or spawn or destroy other processes
indiscriminately.